<div id="site_nodes">
  <% if can? :create, Site %>
  <div class="panel panel-default">
    <div class="panel-body">
      <%= raw SiteConfig.site_index_html %>
      <%= link_to(t("sites.create"), new_site_path, class: "btn btn-success")%>
    </div>
  </div>
  <% end %>

  <% cache(["sites/list", t: CacheVersion.sites_updated_at, d: Date.today]) do %>
    <% @site_nodes.each do |node| %>
    <div class="panel panel-default">
      <div class="panel-heading"><%= node.name %></div>
      <div class="panel-body">
        <% node.sites.each do |item| %>
        <div class="col-md-2 site">
          <%= image_tag(item.favicon_url, class: "favicon")%>
          <%= link_to item.name, item.url, target: "_blank", rel: "nofollow", title: item.desc %>
        </div>
        <% end %>
      </div>
    </div>
    <% end %>
  <% end %>
</div>
